import request from '@/utils/request'

export const controller = new AbortController()

export const getArticleList = ({ current, pageSize }) =>
  request.get('/admin/interview/query', { params: { current, pageSize }, signal: controller.signal })

export const createArticle = data => {
  return request.post('/admin/interview/create', data)
}

export const removeArticle = id => {
  return request.delete('/admin/interview/remove', {
    data: {
      id
    }
  })
}

// request.get('/xx', {})
// request.post('/xx', {}, {})

export const getArticleDetail = id => {
  return request.get('/admin/interview/show', {
    params: {
      id
    }
  })
}

export const updateArticle = data => {
  return request.put('/admin/interview/update', data)
}
